package models

import "gorm.io/gorm"

type Userldentity struct {
	gorm.Model
	RealName string `gorm:"type:varchar(100);not null;commit:'真实姓名'"`
	IdCard   string `gorm:"type:char(18);not null;commit:'身份证号码'"`
	UserId   int64  `gorm:"type:int;not null;commit:'用户Id'"`
}

func (u *Userldentity) Create() error {
	return DB.Create(&u).Error
}
func (u *Userldentity) GetUserLdentidyByuserId() error {
	return DB.Where("user_id=?", u.UserId).Limit(1).Find(&u).Error
}
